package homework;

import java.util.Scanner;

public class day03扩展 {
    public static void main(String[] args) {
        int a =10,b = 5;
        int max = a>b?a:b;
        int min = b<a?b:a;
        System.out.println("最大值="+max);
        System.out.println("最小值="+min);
        if (a>b){
            max = a;
        }else {
            max = b;
        }
        System.out.println("最大值="+max);
        if (b<a){
          min = b;
        }else {
            min = a;
        }
        System.out.println("最小值="+min);

        int year = 2023;
        if (year%400==0){
            System.out.println(year+"是闰年");
        }else {
            System.out.println(year+"是平年");
        }
        if (year%4==0 && year%100!=0){
            System.out.println(year+"是闰年");
        }else {
            System.out.println(year+"是平年");
        }

        int score = 95;
        if (score<0 || score>100){
            System.out.println("成绩不合法");
        }else if (score>=90){
            System.out.println("成绩为A-优秀");
        }else if (score>=80){
            System.out.println("成绩为B-良好");
        }else if (score>=60){
            System.out.println("成绩为C-及格");
        }else {
            System.out.println("成绩为D-不及格");
        }

    }

    public static class chuanjiang {
        public static void main(String[] args) {
            Scanner scan = new Scanner(System.in);
            /*System.out.println("请输入月份:");
            int sc = scan.nextInt();
           int month =sc;
            if (month>=3 && month<=5){
                System.out.println("该季节为春季,主要活动:播种");
            }else if (month>=6 && month<=8){
                System.out.println("该季节为夏季,主要活动:吃烧烤");
            }else if (month>=9 && month<=11){
                System.out.println("该季节为秋季,主要活动:秋收");
            }else if (month==12 || month==1 ||month==2){
                System.out.println("该季节为冬季,主要活动:睡觉");
            }else {
                System.out.println("月份有误");
            }*/

            //求1-100以内的所有偶数的和
            /*int sum =0;
            for (int i=2;i<=100;i+=2){
                sum = sum +i;
            }
            System.out.println("sum="sum);*/
            int sum =0;
            for (int a=1;a<=100;a++){
                if (a%2==0){
                   sum = sum +a;
                }
            }
            System.out.println("sum="+sum);

            //25 36 98 21 3 69 19 用for循环从小到大排列









        }
    }
}

